package com.jason.bookworm.exception;

import com.jason.bookworm.response.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//AOP异常拦截处理
@RestControllerAdvice
public class ProjectExceptionAdvice {
    @ExceptionHandler(ServiceException.class)
    public Result<Object> ExceptionHandling(ServiceException e){
        return new Result<>(e.getCode(),null,e.getMessage());
    }
}
